package com.zhika.zishi.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * Created by shi-02 on 2015/4/8.
 * 重新了onMeasure这个方法，从而保证listView显示完整
 */
public class MeasureListView extends ListView {

    public MeasureListView(Context context){
        super(context);
    }

    public MeasureListView(Context context,AttributeSet attributeSet){
        super(context,attributeSet);
    }

    public MeasureListView(Context context,AttributeSet attributeSet,int defStyle){
        super(context,attributeSet,defStyle);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);

        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
